#ifndef SNAKE_H
#define SNAKE_H

#include <SFML/Graphics.hpp>
#include <vector>
#include "point.h"
#include "constants.h"

class Snake {
private:
    std::vector<Point> body;
    Direction dir;
    Direction nextDir;
    sf::Color color;
    sf::Color borderColor;

public:
    Snake(int startX, int startY, Direction initialDir, sf::Color snakeColor, sf::Color snakeBorderColor);
    void move(const Point& food, bool grow);
    void draw(sf::RenderWindow& window);
    bool checkCollision(const Point& point) const;
    bool checkSelfCollision(const Point& head) const;
    Point getHead() const;
    Direction getDirection() const;
    void setDirection(Direction direction);
    Direction getNextDirection() const;
    void setNextDirection(Direction direction);
    const std::vector<Point>& getBody() const;
    void reset(int startX, int startY, Direction initialDir);
};

#endif // SNAKE_H